<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-07-30 20:02:30
 * @LastEditTime: 2020-02-28 11:25:38
 * @LastEditors: Please set LastEditors
 -->
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/vant.css">
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <script type="text/javascript" src="../script/jquery.js"></script>
    <script type="text/javascript" src="../script/layer/mobile/layer.js"></script>
    <script type="text/javascript" src="../script/vue.min.js"></script>
    <script type="text/javascript" src="../script/vant.min.js"></script>
    <script type="text/javascript" src="../script/fastclick.js"></script>
    <script type="text/javascript" src="../script/base.js"></script>
    <style type="text/css">
        .van-sidebar {
            padding-top: 10px;
            background-color: rgba(0, 0, 0, 0.3);
            height: 100%;
            width: 100%;
        }

        .van-sidebar-item {
            border: 1px solid #e6c678;
            border-radius: 6px;
            width: 95%;
            padding: 8px 10px;
            margin: 4px auto;
            color: #e6c678;
            text-align: center;
        }

        .van-sidebar-item--select {
            color: #090909;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <van-sidebar v-model="currentActive">
            <div v-for="(item, index) in sideList">
                <van-sidebar-item :title="item.name" @click="sideClick(item.url, index)"></van-sidebar-item>
            </div>
        </van-sidebar>
    </div>
</body>

<script type="text/javascript">
    var vm;
    apiready = function () {

        api.addEventListener({
            name: 'handlerLeftSide'
        }, function (ret, err) {
            api.closeFrame()
        });

        vm = new Vue({
            el: '#app',
            data: {
                currentActive: 0,
                sideList: [
                    {
                        name: '工作台',
                        url: 'home',
                    },
                ],
            },
            created: function () {
                var that = this;
                if (window.localStorage.getItem('clientHeight') != 752) {
                    document.getElementById('app').style.zoom = 0
                } else {
                    document.getElementById('app').style.zoom = 1.5
                }
                api.pageParam.equipment = JSON.parse(window.localStorage.getItem('Equipment'))
            },
            methods: {
                sideClick(url, index) {
                    var that = this
                    api.pageParam.choosePlan = false
                    if (window.localStorage.getItem('clientHeight') != 752) {
                        newRect = {
                            x: 0,
                            y: 70,
                            w: api.winWidth,
                            h: api.winHeight - 100 - api.safeArea.bottom
                        }
                    } else {
                        newRect = {
                            x: 0,
                            y: 100,
                            w: api.winWidth,
                            h: api.winHeight - 150 - api.safeArea.bottom
                        }
                    }

                    api.openFrame({
                        name: 'home',
                        url: 'home.html',
                        rect: newRect,
                        bgColor: '#29292a',
                        reload: true,
                        pageParam: api.pageParam
                    })
                    api.closeFrame()
                }
            }
        })
    };
</script>

</html>